;
(function(win) {
    function Loli(options) {
        this._options = options;
        this._data = options.data;
        //代理this._data.xxx下的属性为this.xxx
        _proxy.call(this);
        observe(this._data);
    }

    Loli.prototype = {
        $watch: function(expr, cb) {
            return new Watcher(this, expr, cb);
        }
    };

    function _proxy() {
        Object.keys(this._data).forEach(function(key) {
            var me = this;
            Object.defineProperty(this, key, {
                configurable: true,
                enumerable: true,
                get: function() {
                    return me._data[key];
                },
                set: function(newVal) {
                    me._data[key] = newVal;
                }
            });
        }.bind(this));
    }

    win.Loli = Loli;
})(window);